home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Utilities / Programming / EnterAct 3.5 / Drag_on Modules / hAWK programs / $PromptTest < prev    next >
Encoding:
Text File  |  1991-10-27  |  524 b   |  26 lines  |  [TEXT/KEEN]

  1. #$PromptTest
  2. #Echo a user response to prompt
  3.  
  4. BEGIN {    answer1 = prompt("This is a test - enter a string below:")
  5.         if (answer1 != "")
  6.             print answer1
  7.         else
  8.             {
  9.             print "Null response for first answer"
  10.             exit
  11.             }
  12.         answer2 = prompt("Try another string:")
  13.         if (answer2 != "")
  14.             print answer2
  15.         else
  16.             {
  17.             print "Null response for second answer"
  18.             exit
  19.             }
  20.         if (answer1+0 != 0 && answer2+0 != 0)
  21.             {
  22.             print "Both strings were, at least in part, numbers"
  23.             print "and their sum is: ", answer1 + answer2
  24.             }
  25.     }
  26.